package com.sanploy.common.domain;

import com.sanploy.common.enums.OrderPayStatus;
import com.sanploy.common.enums.OrderStatus;

/**
 * Created by zhu yingzhi on 2017/9/26.
 * @author yingzhi zhu
 * 订单实体类
 */

public class Order {
    /**
     * 订单Id 生成规则 yyyyMMddHHmmssMMMM+USERID
     */
    private String order_id;
    /**
     * 用户标识
     */
    private Long user_id;
    /**
     * 订单总价格
     */
    private double order_price;
    /**
     * 订单状态(未确认,确认,已取消,无效,退货)
     */
    private OrderStatus order_status;
    /**
     * （支付状态 ：未付款;付款中;已付款）
     */
    private OrderPayStatus pay_status; 
    /**
     * 收货人省份
     */
    private String province;
    /**
     * 收货人城市
     */
    private String city;
    /**
     * 收货人街道
     */
    private String street;
    /**
     * 收货人地区
     */
    private String district;
    /**
     * 收货详细地址
     */
    private String address;
    /**
     * 收货邮编
     */
    private String zipcode;
    /**
     * 收货人电话
     */
    private String phone;
    /**
     * 订单备注
     */
    private String postscript;
    /**
     * 订单生成时间
     */
    private String add_time;
    /**
     * 订单支付时间
     */
    private String pay_time;
    /**
     * 订单发货时间
     */
    private String shipping_time;
    /**
     * 收货人姓名
     */
    private String name;
    /**
     * 订单运费价格
     */
    private double freight_price;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getShipping_time() {
        return shipping_time;
    }

    public void setShipping_time(String shipping_time) {
        this.shipping_time = shipping_time;
    }

    public double getFreight_price() {
        return freight_price;
    }

    public void setFreight_price(double freight_price) {
        this.freight_price = freight_price;
    }

    public String getOrder_id() {
        return order_id;
    }

    public void setOrder_id(String order_id) {
        this.order_id = order_id;
    }

    public Long getUser_id() {
        return user_id;
    }

    public void setUser_id(Long user_id) {
        this.user_id = user_id;
    }

    public double getOrder_price() {
        return order_price;
    }

    public void setOrder_price(double order_price) {
        this.order_price = order_price;
    }

    public OrderStatus getOrder_status() {
        return order_status;
    }

    public void setOrder_status(OrderStatus order_status) {
        this.order_status = order_status;
    }

    public OrderPayStatus getPay_status() {
        return pay_status;
    }

    public void setPay_status(OrderPayStatus pay_status) {
        this.pay_status = pay_status;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getZipcode() {
        return zipcode;
    }

    public void setZipcode(String zipcode) {
        this.zipcode = zipcode;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPostscript() {
        return postscript;
    }

    public void setPostscript(String postscript) {
        this.postscript = postscript;
    }

    public String getAdd_time() {
        if (add_time!=null && add_time.contains(".0")){
            add_time = add_time.substring(0,add_time.length()-2);
        }
        return add_time;
    }

    public void setAdd_time(String add_time) {
        this.add_time = add_time;
    }

    public String getPay_time() {
        return pay_time;
    }

    public void setPay_time(String pay_time) {
        this.pay_time = pay_time;
    }
}
